<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /* 字符串转数字类型 */
    /*   const string = "99";
      console.log(typeof string);
      console.log(string + 78);
      console.log(string * 1 + 78);
      console.log(Number(string) + 78); */

    /* 数字类型转换为字符串类型 */

    /*  
        const number = 66;
        console.log(typeof number);
        const str = number + "";
        console.log(str);
        console.log(typeof str);
        console.log(typeof String(number)); */

    /*     const string = "aa99wangyanng";
        console.log(parseInt(string)); //  NAN */

    /*  const string = "99wangyanng";
     console.log(parseInt(string)); //  99 */

    /*   const string = "99.78wangyanng";
      console.log(parseFloat(string)); //  99.78 */

    /*    const string = "99.78wangyanng";
       console.log(parseInt(string)); //  99 */
    /* 
        const wangyang = 'wangyang'
        console.log(wangyang.split("").length); // 8
        console.log(wangyang.split("")); // (8) ["w", "a", "n", "g", "y", "a", "n", "g"]
     */

    /*  const array = ['wangyang', 'xiaoxiao', 'dada']
     console.log(array.join('')); // wangyangxiaoxiaodada */

    /*   let wangyang = new String('wangyang');
      console.log(typeof wangyang);
      console.log(wangyang.substr(3)); */

    const array = ['wangyang', 'xiaoxiao', 'dada']
    console.log(array); // (3) ["wangyang", "xiaoxiao", "dada"]
    console.log(array.toString()); // wangyang,xiaoxiao,dada

    const number = 99;
    console.log(typeof number);
    const newNumber = number.toString();
    console.log(newNumber); // 字符串99
  </script>
</body>

</html>